kmpkg_from_gitee(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO kumo-pub/duckdb
    REF "v${VERSION}"
    SHA512 7d91a0e0388e5ba39f5c1576301ab5f31d6b193df33b5415b7d8e2d88593333c28aaedfa07f5d29a5fd92b35e1ce8d0be4ac4167b9e779c4ed808f2447cdf4fb
    HEAD_REF master
)

kmpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}"
    OPTIONS
        -DBUILD_UNITTESTS=OFF
        -DENABLE_SANITIZER=OFF
        -DENABLE_UBSAN=OFF
)

kmpkg_cmake_install()

kmpkg_copy_pdbs()
kmpkg_cmake_config_fixup(PACKAGE_NAME duckdb CONFIG_PATH lib/cmake/DuckDB)
kmpkg_fixup_pkgconfig()

kmpkg_copy_tools(TOOL_NAMES duckdb AUTO_CLEAN)


file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

kmpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
